确定
此时,各项值均为默认值,效果如下:有边框以及圆角
![img](https://img-blog.csdnimg.cn/img_convert/ff8c578f6467eafa746b555a5cfcaaeb.png)
设置其css如下:背景颜色background-color文字颜色color,设置type为primary是背景色为微信绿,无法设置背景颜色
.btn1 {
width: 80%;
margin-top: 20rpx;
background-color: beige;
color: white;
}
![img](https://img-blog.csdnimg.cn/img_convert/08b13517442b4e413e2f35637a0139bf.png)
修改圆角:
.btn1 {
width: 80%;
margin-top: 20rpx;
background-color: beige;
color: white;
border-radius: 98rpx;
}
![img](https://img-blog.csdnimg.cn/img_convert/804a8499f27ee438fe2c10d6df27f533.png)
效果并不好,此时增加
.btn1::after {
border-radius: 98rpx;
}
效果图如下:
![img](https://img-blog.csdnimg.cn/img_convert/c5ea831308a51a168fffad6b5239b6cc.png)
如果需要取消边框,在::after中增加border: 0;
![img](https://img-blog.csdnimg.cn/img_convert/59b7570cab78bd9daec750ec6bcfaa7f.png)
这样子的button是达不到UI的要求的,我们还需要添加图片,开始直接在button里面加了张图片,可是就是对不齐
确定
.btn1 {
width: 80%;
margin-top: 20rpx;
background-color: burlywood;
color: white;
border-radius: 98rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}
.btnImg {
margin-right: 8rpx;
width: 46rpx;
height: 46rpx;
}
.btn1::after {
border-radius: 98rpx;
border: 0;
}
效果图如下:
![img](https://img-blog.csdnimg.cn/img_convert/d984762dfa15dac0086a09ce84fd5536.png)
还有上图下字效果:
联系客服
授权设置
.btn1{
width: 200rpx;
height: 200rpx;
margin-top: 20rpx;
background-color: white;
color: #999999;
border-radius: 0rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: 30rpx;
}
.btnImg {
width: 50rpx;
height: 50rpx;
}
.btn1::after {
border: 0;
}
.btn2 {
width: 200rpx;
height: 200rpx;
margin-top: 20rpx;
background-color: white;
color: #999999;
border-radius: 0rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: 30rpx;
}
.btn2::after {
border: 0;
}
效果图如下:
![img](https://img-blog.csdnimg.cn/img_convert/ef6343b424d199df1d840011499087a2.png)
点击高亮状态
//设置none则无高亮状态
hover-class="none"
//可以绑定一个class,到css中设置高亮样式
禁止点击状态
disable="true"
此时按钮状态由系统决定,无法改变,但是有时我们又需要自定义,所以
|